/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦，本文采用木兰宽松许可证第2版]
 * 
 * https://zhiqim.org/project/zhiqim_kit/zhiqim_git.htm
 *
 * ZhiqimGit is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.git.command;

import java.util.List;

import org.zhiqim.git.Git;
import org.zhiqim.git.GitCommand;
import org.zhiqim.git.refer.Ref;
import org.zhiqim.git.refer.RefComparator;


/**
 * 标签查询列表命令
 * http://www.kernel.org/pub/software/scm/git/docs/git-tag.html
 * 
 * @version v1.0.0 @author zhichenggang 2017-3-12 新建与整理
 */
public class TagListCommand extends GitCommand<List<Ref>>
{
    public TagListCommand(Git git)
    {
        super(git);
    }
    
    /******************************************************************************/
    //预处理&执行
    /******************************************************************************/

    protected List<Ref> execute() throws Exception
    {
        return RefComparator.sort(git.getTags());
    }
}
